home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / xecho11.zip / SETFX.BAT < prev    next >
DOS Batch File  |  1989-02-11  |  8KB  |  269 lines

  1. echo off
  2. rem SETFX.BAT: send control codes to epson "FX" type printer
  3. rem
  4. rem run SETFX (without options) for a help screen
  5. rem
  6. if "%1"=="" goto help
  7. for %%p in (help HELP) do if "%1"=="%%p" goto help
  8. goto keyword
  9. :next
  10. shift
  11. :keyword
  12. if "%1"=="" goto exit
  13. for %%p in (no NO) do if "%1"=="%%p" goto no
  14. for %%p in (initial INITIAL) do if "%1"=="%%p" goto init
  15. for %%p in (init INIT) do if "%1"=="%%p" goto init
  16. for %%p in (cpi CPI) do if "%1"=="%%p" goto cpi
  17. for %%p in (cpi10 CPI10 10) do if "%1"=="%%p" goto cpi10
  18. for %%p in (cpi12 CPI12 12) do if "%1"=="%%p" goto cpi12
  19. for %%p in (cpi17 CPI17 17) do if "%1"=="%%p" goto cpi17
  20. for %%p in (cpi20 CPI20 20) do if "%1"=="%%p" goto cpi20
  21. for %%p in (lpi LPI) do if "%1"=="%%p" goto lpi
  22. for %%p in (lpi6 LPI6 6) do if "%1"=="%%p" goto lpi6
  23. for %%p in (lpi8 LPI8 8) do if "%1"=="%%p" goto lpi8
  24. for %%p in (draft DRAFT) do if "%1"=="%%p" goto draft
  25. for %%p in (nlq NLQ) do if "%1"=="%%p" goto nlq
  26. for %%p in (nonlq NONLQ) do if "%1"=="%%p" goto draft
  27. for %%p in (wide WIDE) do if "%1"=="%%p" goto wide
  28. for %%p in (nowide NOWIDE) do if "%1"=="%%p" goto nowide
  29. for %%p in (emphasized EMPHASIZED) do if "%1"=="%%p" goto emph
  30. for %%p in (noemphasized NOEMPHASIZED) do if "%1"=="%%p" goto noemph
  31. for %%p in (thick THICK) do if "%1"=="%%p" goto thick
  32. for %%p in (nothick NOTHICK) do if "%1"=="%%p" goto nothick
  33. for %%p in (proportional PROPORTIONAL) do if "%1"=="%%p" goto prop
  34. for %%p in (noproportional NOPROPORTIONAL) do if "%1"=="%%p" goto noprop
  35. for %%p in (italic ITALIC italics ITALICS) do if "%1"=="%%p" goto italic
  36. for %%p in (noitalic NOITALIC noitalics NOITALICS) do if "%1"=="%%p" goto noitalic
  37. for %%p in (normal NORMAL) do if "%1"=="%%p" goto normal
  38. for %%p in (uni UNI unidirectional UNIDIRECTIONAL) do if "%1"=="%%p" goto uni
  39. for %%p in (bi BI bidirectional BIDIRECTIONAL) do if "%1"=="%%p" goto bi
  40. for %%p in (margins MARGINS) do if "%1"=="%%p" goto margins
  41. for %%p in (lm LM left LEFT) do if "%1"=="%%p" goto lm
  42. for %%p in (rm RM right RIGHT) do if "%1"=="%%p" goto rm
  43. for %%p in (tabs TABS) do if "%1"=="%%p" goto tabs
  44. for %%p in (pl PL) do if "%1"=="%%p" goto pl
  45. for %%p in (pll PLL) do if "%1"=="%%p" goto pll
  46. for %%p in (pli PLI) do if "%1"=="%%p" goto pli
  47. for %%p in (page PAGE) do if "%1"=="%%p" goto page
  48. for %%p in (pagelength PAGELENGTH) do if "%1"=="%%p" goto pl2
  49. for %%p in (tof TOF) do if "%1"=="%%p" goto tof
  50. for %%p in (skip SKIP) do if "%1"=="%%p" goto skip
  51. for %%p in (noskip NOSKIP) do if "%1"=="%%p" goto noskip
  52. for %%p in (pos POS) do if "%1"=="%%p" goto skip
  53. for %%p in (nopos NOPOS) do if "%1"=="%%p" goto noskip
  54. echo ERROR: unrecognised parameter: %1
  55. echo.
  56. goto help
  57. :no
  58. for %%p in (nlq NLQ) do if "%1"=="%%p" goto draft
  59. for %%p in (wide WIDE) do if "%1"=="%%p" goto nowide
  60. for %%p in (emphasized EMPHASIZED) do if "%1"=="%%p" goto noemph
  61. for %%p in (thick THICK) do if "%1"=="%%p" goto nothick
  62. for %%p in (proportional PROPORTIONAL) do if "%1"=="%%p" goto noprop
  63. for %%p in (italic ITALIC italics ITALICS) do if "%1"=="%%p" goto noitalic
  64. for %%p in (skip SKIP) do if "%1"=="%%p" goto noskip
  65. for %%p in (pos POS) do if "%1"=="%%p" goto noskip
  66. echo ERROR: unrecognised parameter after NO: %1
  67. echo.
  68. goto help
  69. :init
  70. xecho \027@>prn
  71. goto next
  72. :cpi
  73. shift
  74. if "%1"=="10" goto cpi10
  75. if "%1"=="12" goto cpi12
  76. if "%1"=="17" goto cpi17
  77. if "%1"=="20" goto cpi20
  78. echo ERROR: illegal value specified: %1
  79. echo (characters per inch not set)
  80. goto next
  81. :cpi10
  82. xecho \018\027P>prn
  83. goto next
  84. :cpi12
  85. xecho \018\027M>prn
  86. goto next
  87. :cpi17
  88. xecho \027P\015>prn
  89. goto next
  90. :cpi20
  91. xecho \027M\015>prn
  92. goto next
  93. :lpi
  94. shift
  95. if "%1"=="6" goto lpi6
  96. if "%1"=="8" goto lpi8
  97. echo ERROR: illegal value specified: %1
  98. echo (lines per inch not set)
  99. goto next
  100. :lpi6
  101. xecho \0272>prn
  102. goto next
  103. :lpi8
  104. xecho \0270>prn
  105. goto next
  106. :draft
  107. xecho \027x\0>prn
  108. goto next
  109. :nlq
  110. xecho \027x\1>prn
  111. goto next
  112. :emph
  113. xecho \027E>prn
  114. goto next
  115. :noemph
  116. xecho \027F>prn
  117. goto next
  118. :thick
  119. xecho \027G>prn
  120. goto next
  121. :thick
  122. xecho \027H>prn
  123. goto next
  124. :wide
  125. xecho \027W\1>prn
  126. goto next
  127. :nowide
  128. xecho \027W\0>prn
  129. goto next
  130. :prop
  131. xecho \027p\1>prn
  132. goto next
  133. :noprop
  134. xecho \027p\0>prn
  135. goto next
  136. :italic
  137. xecho \0274>prn
  138. goto next
  139. :noitalic
  140. xecho \0275>prn
  141. goto next
  142. :normal
  143. xecho \027F\027H\027p\0\027W\0\0275>prn
  144. goto next
  145. :uni
  146. for %%p in (directional DIRECTIONAL) do if "%1"=="%%p" shift
  147. xecho \027U\1>prn
  148. goto next
  149. :bi
  150. for %%p in (directional DIRECTIONAL) do if "%1"=="%%p" shift
  151. xecho \027U\0>prn
  152. goto next
  153. :margins
  154. shift
  155. xecho \027I\%1>prn
  156. shift
  157. xecho \027Q\%1>prn
  158. goto next
  159. :lm
  160. shift
  161. for %%p in (margin MARGIN) do if "%1"=="%%p" shift
  162. xecho \027l\%1>prn
  163. goto next
  164. :rm
  165. shift
  166. for %%p in (margins MARGIN) do if "%1"=="%%p" shift
  167. xecho \027Q\%1>prn
  168. goto next
  169. :tabs
  170. set $t=
  171. :tabs1
  172. shift
  173. if "%1"=="" goto tabs2
  174. if "%1"=="0" goto tabs2
  175. set $t=$t\%1
  176. goto tabs1
  177. :tabs2
  178. xecho \027D%$t%\0>prn
  179. set $t=
  180. goto next
  181. :pl
  182. shift
  183. goto pl2
  184. :page
  185. shift
  186. for %%p in (length LENGTH) do if "%1"=="%%p" shift
  187. :pl2
  188. for %%p in (l L lines LINES) do if "%1"=="%%p" goto pll
  189. for %%p in (i I inches INCHES) do if "%1"=="%%p" goto pli
  190. goto pll2
  191. :pll
  192. shift
  193. :pll2
  194. xecho \027C\%1>prn
  195. goto next
  196. :pli
  197. shift
  198. :pli2
  199. xecho \027C\0\%1>prn
  200. goto next
  201. :tof
  202. echo TOF function is not available via software on this printer
  203. goto next
  204. :pos
  205. xecho \0279>prn
  206. goto next
  207. :nopos
  208. xecho \0278>prn
  209. goto next
  210. :skip
  211. xecho \027N\2>prn
  212. goto next
  213. :noskip
  214. xecho \027O>prn
  215. goto next
  216. :help
  217. cls
  218. echo Usage: SETFX param1 param2 ...   where "params" can be:
  219. echo.
  220. echo        INITIAL or INIT         - sets printer to turn-on state
  221. echo        CPI10 or CPI 10 or 10   - set 10 cpi (chars per inch)
  222. echo        CPI12 or CPI 12 or 12   - set 12 cpi (not av. in NLQ)
  223. echo        CPI17 or CPI 17 or 17   - set 17 cpi (not av. in NLQ)
  224. echo        CPI20 or CPI 20 or 20   - set 20 cpi (not av. in NLQ)
  225. echo        LPI6  or LPI 6  or  6   - set 6 lpi (lines per inch)
  226. echo        LPI8  or LPI 8  or  8   - set 8 lpi
  227. echo.
  228. echo        For the following, (NO) indicates that the function is disabled by
  229. echo        putting "NO" before the keyword (as two words or one).
  230. echo.
  231. echo        DRAFT                   - set draft printing
  232. echo        (NO)NLQ                 - set NLQ printing ("NO NLQ" == "DRAFT")
  233. echo        (NO)EMPHASIZED          - double print lines for darker chars
  234. echo        (NO)THICK               - double print lines for thicker chars
  235. echo        (NO)WIDE                - double width chars
  236. echo        (NO)PROPORTIONAL        - emphasized, proportional printing
  237. echo        (NO)ITALIC or ITALICS   - italic characters (not av. in NLQ)
  238. echo        NORMAL                  - cancel EMPHASIZED,THICK,WIDE,ITALIC,PROPOR.
  239. echo        UNI[DIRECTIONAL]        - uni-directional printing
  240. echo        BI[DIRECTIONAL]         - bi-directional printing
  241. echo.
  242. pause
  243. cls
  244. echo SETFX Usage Continued.
  245. echo.
  246. echo        For the following "n" is a decimal number from 1 to 255.  These
  247. echo        parameters must follow keywords as shown or results unpredictable.
  248. echo        Words in [...] are optional.  Those shown joined to previous word
  249. echo        can also be separate words.
  250. echo.
  251. echo        For margins, "n" are char posn; minimum and maximum depend on pitch.
  252. echo        For tabs, "n" are char posn; 0 to 32 values in ascending order may be
  253. echo        used and must be followed by a "0"; Use "TABS 0" to clear all tabs.
  254. echo        For page length, "n" can be 1 to 127 lines or 1 to 22 inches.
  255. echo        Setting page length also sets top-of-form.
  256. echo.
  257. echo        MARGINS n n             - set left and right margins (cancels tabs)
  258. echo        LEFT [MARGIN] or LM n   - set left margin
  259. echo        RIGHT [MARGIN] or RM n  - set right margin
  260. echo        TABS n n n ... 0        - set tab stops
  261. echo.
  262. echo        PL[L or I] n             - set page length in lines (or inches)
  263. echo        PAGE[LENGTH] [LINES or INCHES] n - set page length in lines (or inches)
  264. echo        TOF                     - set top of form (not available on FX)
  265. echo        (NO)SKIP                -